package com.example.sqlite.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class StuDBHelper extends SQLiteOpenHelper {
	private static final String TAG = "TestSQLite";
	public static final int VERSION = 1;
	public StuDBHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
	}

	/**
	 * 创建数据库
	 */
	@Override
	public void onCreate(SQLiteDatabase db) {
		String createSQL = "create table if not exists db_stu (id int,sname varchar(20),sage int,ssex varchar(10))";
		db.execSQL(createSQL);
		Log.i(TAG, "StuDBHelper::onCreate--->");
	}

	/**
	 * 更新数据库
	 */
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		Log.i(TAG, "StuDBHelper::onUpgrade--->");
	}
	
}
